package chaoyue.study.listener;

import lombok.extern.slf4j.Slf4j;
import org.activiti.engine.delegate.DelegateTask;
import org.activiti.engine.delegate.TaskListener;
import org.springframework.stereotype.Component;

/**
 * 自定义Activiti任务监听器
 */
@Slf4j
@Component
public class MyTaskListener implements TaskListener {
    @Override
    public void notify(DelegateTask delegateTask) {
        if (delegateTask.getName().equals("员工填写出差单")
                && delegateTask.getEventName().equals("create")) {
            log.info("员工填写出差单任务创建...");
        }
    }
}
